$(document).ready(function() {
	var allItems = $('div.boxC ul.boxCTabs a');
	var allLists = $('div.boxC ul.boxCLists li');
	var loadingIcon = '<img src="'+baseUrl+'/images/ajax-loader.gif" alt="载入中" title="载入中" style="margin-left: 20px;" />';
	// var currentIndex = 0;

	$.each(allItems, function(i, e) {
		$(e).mouseover(function() {
            var _this = $(this);
            _this.attr('stillMouseover', 'true');
//            alert($(this).attr('stillMouseover'));
            window.setTimeout(function() {
                if(_this.attr('stillMouseover') != 'false') {
                    _this.parents('div.boxC').find('ul.boxCLists li').hide();
                    allLists.eq(i).show();
                    _this.parents('ul.boxCTabs').find('a').removeClass('linkOn');
                    _this.addClass('linkOn');

                    // currentIndex = i;

                    hiddenFld = allLists.eq(i).children(':hidden.categoryId');
                    var section = allLists.eq(i);
                    if(hiddenFld.length > 0) {
                        section.html(loadingIcon);
                        $.post(baseUrl+'/index.php/index/section', { categoryId : hiddenFld.val() }, 
                            function(data) {
                                if(data) {
                                    section.html(data);
                                }
                            }
                        );
                    }
                }
            }, 60);
		})
        $(e).mouseout(function() {
            $(this).attr('stillMouseover', 'false');
  //          alert($(this).attr('stillMouseover')+'!');
        });
	});

	$('#qqListLink').fancybox({
		hideOnContentClick : false,
    	centerOnScroll : false,
		frameHeight : 720,
		frameWidth : 480,
		overlayOpacity : 0.15
	});
	
	
	$.oSlides({
		imgPath : imgPath,
		linkTo : linkTo,
//		scrollEvent : 'click',
		descr : descr
	});
});
